home *** CD-ROM | disk | FTP | other *** search
/ Practical Web Pages 2004 September / PracticalWebPages-WPG13-09-2004-Coverdisc.iso / pc / Software / Toolkit / Sothink SWF Quicker 1.5 / data1.cab / Public_Files / Effects / ActionScript / Rotate / Rotation.sqe < prev    next >
Encoding:
Text File  |  2004-06-14  |  2.0 KB  |  91 lines

  1. ========== Description Part Begin ==========
  2. name = "Rotation";
  3. description = "The rotation directions of characters are different. If one is clockwise,  the next one will be counter-clockwise.";
  4. version = "1.00";
  5. bin = "Rotation.bin";
  6. ========== Description Part End ==========
  7.  
  8.  
  9. ========== Parameter Part Begin ==========
  10. $nCharacterCount(EDIT,INT,1,1 10000,"Total Characters ","The total characters using the special effect. The value is defined by the selected characters in the movie, but can not be changed in the property box.");
  11. $nFrameCount(EDIT,INT,3,3 3,"Total Frames","It indicates the total frames of actions. The total frames of the effect is probably more than it.");
  12.  
  13.  
  14. $nSpeed(EDIT,INT,20,1 100,"Rotating Speed","The rotating speed of characters.");
  15. ========== Parameter Part End ==========
  16.  
  17.  
  18. ========== Function Part Begin ==========
  19. nCharacterCount = 4;
  20. nFrameCount = 3;
  21. nSpeed = 3;
  22.  
  23. nCharacter_x = new Array(nCharacterCount);
  24. nCharacter_y = new Array(nCharacterCount);
  25. nIsRun = new Array(nCharacterCount);
  26.  
  27. for (i = 1; nCharacterCount >= i; i++)
  28. {
  29.     this["c" + i]._alpha = 100;
  30.     this["c" + i]._rotation = 0;
  31.     nCharacter_x[i - 1] = this["c" + i]._x;
  32.     nCharacter_y[i - 1] = this["c" + i]._y;
  33.     nIsRun[i - 1] = random(nCharacterCount *2);
  34. }
  35.  
  36.  
  37. function fun()
  38. {
  39.     for (i = 1; nCharacterCount >= i; i++)
  40.     {
  41.         nIsRun[i - 1] -= 1;
  42.         if(nIsRun[i - 1] <  0)
  43.         {
  44.             this["c" + i]._alpha -= nSpeed;
  45.             this["c" + i]._rotation = 0;        
  46.                         
  47.         }
  48.         
  49.         
  50.     }
  51.     
  52.     restart();
  53.   
  54.  
  55. function restart()
  56. {
  57.     bIsRestart = true;
  58.     for (i = 1; nCharacterCount >= i; i++)
  59.     {
  60.         if(    this["c" + i]._alpha > 0)
  61.         {
  62.             bIsRestart = false;
  63.             break;
  64.         }
  65.  
  66.     }
  67.     if(bIsRestart)
  68.     {
  69.         this["c" + i]._x = nCharacter_x[i - 1];
  70.         this["c" + i]._y = nCharacter_y[i - 1];
  71.         gotoAndPlay(1);
  72.     }
  73.     
  74. }
  75.  
  76.  
  77. function again()
  78. {
  79.     gotoAndPlay(2);
  80. }
  81.  
  82. ========== Function Part End ==========
  83.  
  84.  
  85. ========== Frame Part Begin ==========
  86. $frame(fun,1,-1,"fun");
  87. $frame(fun,2,-1,"fun");
  88. $frame(again,3,-1,"fun");
  89. ========== Frame Part End ==========